<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>安装</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="dba.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="dba.configuration.html">运行时配置</a></div>
 <div class="up"><a href="dba.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="dba.installation" class="section">
 <h2 class="title">安装</h2>
 <p class="para">
  By using the <strong class="option configure">--enable-dba=shared</strong>

  configuration option you can build a dynamic loadable module to enable PHP
  for basic support of dbm-style databases. You also have to add support
  for at least one of the following handlers by specifying the
  <strong class="option configure">--with-XXXX</strong>
 configure switch to your PHP
  configure line.
 </p>
 <div class="warning"><strong class="warning">Warning</strong>
  <p class="para">
   After configuring and compiling PHP you must execute the following test
   from commandline: <em>php run-tests.php ext/dba</em>. This shows
   whether your combination of handlers works. Most problematic are 
   <em>dbm</em> and <em>ndbm</em> which conflict with
   many installations. The reason for this is that on several systems these
   libraries are part of more than one other library. The configuration test
   only prevents you from configuring malfunctioning single handlers but not 
   combinations.
  </p>
 </div>
 <p class="para">
  <table class="doctable table">
   <caption><strong>Supported DBA handlers</strong></caption>
   
    <thead>
     <tr>
      <th>Handler</th>
      <th>Configure Switch</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><em>dbm</em></td>
      <td>
       <p class="para">
       To enable support for dbm add
       <strong class="option configure">--with-dbm[=DIR]</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         dbm normally is a wrapper which often results in failures.
         This means you should only use dbm if you are sure it works
         and if you really need this format.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><em>ndbm</em></td>
      <td>
       <p class="para">
       To enable support for ndbm add
       <strong class="option configure">--with-ndbm[=DIR]</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         ndbm normally is a wrapper which often results in failures.
         This means you should only use ndbm if you are sure it works
         and if you really need this format.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><em>gdbm</em></td>
      <td>
       To enable support for gdbm add
       <strong class="option configure">--with-gdbm[=DIR]</strong>
.
      </td>
     </tr>


     <tr>
      <td><em>db2</em></td>
      <td>
       <p class="para">
       To enable support for Oracle Berkeley DB 2 add
       <strong class="option configure">--with-db2[=DIR]</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         db2 conflicts with db3 and db4.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><em>db3</em></td>
      <td>
       <p class="para">
       To enable support for Oracle Berkeley DB 3 add
       <strong class="option configure">--with-db3[=DIR]</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         db3 conflicts with db2 and db4.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><em>db4</em></td>
      <td>
       <p class="para">
       To enable support for Oracle Berkeley DB 4 or 5 add
       <strong class="option configure">--with-db4[=DIR]</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         db4 conflicts with db2 and db3.
        </p>
       </p></blockquote>
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         The db4 option was added in PHP 4.3.2. In earlier versions of PHP you need to use
         <strong class="option configure">--with-db3=DIR</strong>
 with DIR being the
         path to db4 library. It is not possible to use db versions starting 
         from 4.1 with PHP prior to version 4.3.0. Also, the db libraries with
         versions 4.1 through 4.1.24 cannot be used in any PHP version.
        </p>
        <p class="para">
         Support for BDB 5 was added in PHP 5.3.3.
        </p>
       </p></blockquote>
      </p>
      </td>
     </tr>


     <tr>
      <td><em>cdb</em></td>
      <td>
       <p class="para">
       To enable support for cdb add
       <strong class="option configure">--with-cdb[=DIR]</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         Since PHP 4.3.0 you can omit DIR to use the bundled cdb library 
         that adds the cdb_make handler which allows creation of cdb files
         and allows to access cdb files on the network using PHP&#039;s streams.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><em>flatfile</em></td>
      <td>
       <p class="para">
       To enable support for flatfile add
       <strong class="option configure">--with-flatfile</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         This was added in PHP 4.3.0 to add compatibility with deprecated
         <em>dbm</em> extension. Use this handler only
         when you cannot install one of the libraries required by the other
         handlers and when you cannot use bundled cdb handler.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><em>inifile</em></td>
      <td>
       <p class="para">
       To enable support for <em>inifile</em> add
       <strong class="option configure">--with-inifile</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         This was added in PHP 5.0.0 and allows to read and set microsoft style
         <var class="filename">.ini</var> files (like the <var class="filename">php.ini</var> file).
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


     <tr>
      <td><em>qdbm</em></td>
      <td>
       <p class="para">
       To enable support for qdbm add
       <strong class="option configure">--with-qdbm[=DIR]</strong>
.
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         qdbm conflicts with dbm and gdbm.
        </p>
       </p></blockquote>
       <blockquote class="note"><p><strong class="note">Note</strong>: 
        <p class="para">
         This was added in PHP 5.0.0. The qdbm library can be loaded from
         <a href="http://fallabs.com/qdbm/index.html" class="link external">&raquo;&nbsp;http://fallabs.com/qdbm/index.html</a>.
        </p>
       </p></blockquote>
       </p>
      </td>
     </tr>


    </tbody>
   
  </table>

  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Up to PHP 4.3.0 you are able to add both db2 and db3 handler but only one
    of them can be used internally. That means that you cannot have both file 
    formats. Starting with PHP 5.0.0 there is a configuration check avoid such
    misconfigurations.
   </p>
  </p></blockquote>
 </p>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="dba.requirements.html">需求</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="dba.configuration.html">运行时配置</a></div>
 <div class="up"><a href="dba.setup.html">安装／配置</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
